//
//  SCRadioMoreTableViewCell.m
//  LastOne
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 sc. All rights reserved.
//

#import "SCRadioMoreTableViewCell.h"
#import <UIImageView+WebCache.h>
#import "NightHeader.h"
#import "FitHeader.h"
@implementation SCRadioMoreTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createViews];
    }
    return self;
}

- (void)createViews
{
    _bigImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:_bigImageView];
    
    _playImageView = [[UIImageView alloc] init];
    [_bigImageView addSubview:_playImageView];
    
    _titleLabel = [[UILabel alloc] init];
    [_titleLabel NightWithType:UIViewColorTypeNormal];
    [self.contentView addSubview:_titleLabel];
    
    _cnameLabel = [[UILabel alloc] init];
    [_cnameLabel NightWithType:UIViewColorTypeNormal];
    [self.contentView addSubview:_cnameLabel];
}

- (void)setRadioModel:(SCRadioModel *)radioModel
{
    if (_radioModel != radioModel) {
        _radioModel = radioModel;
    }
    [_bigImageView sd_setImageWithURL:[NSURL URLWithString:radioModel.imgsrc] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    _titleLabel.text = radioModel.title;
    _cnameLabel.text = radioModel.tname;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _bigImageView.frame = CGRectMake(10 * FitWidth, 10 * FitHeight, 90 * FitWidth, 90 * FitWidth);
    _bigImageView.layer.masksToBounds = YES;
    _bigImageView.layer.cornerRadius = 45 * FitWidth;
    
    _playImageView.frame = CGRectMake(22 * FitWidth, 22 * FitHeight, 50 * FitWidth, 50 * FitWidth);
    _playImageView.layer.masksToBounds = YES;
    _playImageView.layer.cornerRadius = 25 * FitWidth;
    _playImageView.image = [UIImage imageNamed:@"bofanganniu"];
    
    _cnameLabel.frame = CGRectMake(_bigImageView.frame.origin.x + _bigImageView.frame.size.width + 10 * FitWidth, _bigImageView.frame.origin.y + 10 * FitHeight, 260 * FitWidth, 30 * FitHeight);
    
    _titleLabel.frame = CGRectMake(_cnameLabel.frame.origin.x, _cnameLabel.frame.origin.y + _cnameLabel.frame.size.height, _cnameLabel.frame.size.width, 50 * FitHeight);
    
}
@end
